<?php

//Lưu xuống csdl đã học từ vựng
$idLesson = $_SESSION['idLesson'];
$IDUserOnline = elgg_get_logged_in_user_guid();

$status = new Status();
$status->SetStatusVocabulary($IDUserOnline, $idLesson);
//End Lưu xuống csdl đã học từ vựng

$word = new Word();
$Mywords = $word->loadAllWords($idLesson);
session_start();

$_SESSION["WordsResult"] = $Mywords;



if (session_is_registered("WordsResult")) {
    system_messages("session is registered!");
}


if ($Mywords != false) {
    system_message("Going to vocabulary");

    forward(elgg_get_site_url() . "MyCourse/vocabulary");
} else {
    register_error("can not going to vocabulary");
    forward(REFERER); // REFERER is a global variable that defines the previous page
}
?>
    

